/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "MashNotes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MashNotes.findAll", query = "SELECT m FROM MashNotes m"),
    @NamedQuery(name = "MashNotes.findByNoteID", query = "SELECT m FROM MashNotes m WHERE m.noteID = :noteID"),
    @NamedQuery(name = "MashNotes.findByMashType", query = "SELECT m FROM MashNotes m WHERE m.mashType = :mashType"),
    @NamedQuery(name = "MashNotes.findByStopTime", query = "SELECT m FROM MashNotes m WHERE m.stopTime = :stopTime"),
    @NamedQuery(name = "MashNotes.findByTemp", query = "SELECT m FROM MashNotes m WHERE m.temp = :temp"),
    @NamedQuery(name = "MashNotes.findByNotes", query = "SELECT m FROM MashNotes m WHERE m.notes = :notes")})
public class MashNotes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "noteID")
    private Integer noteID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mashType")
    private int mashType;
    @Basic(optional = false)
    @NotNull
    @Column(name = "stopTime")
    @Temporal(TemporalType.TIME)
    private Date stopTime;
    @Basic(optional = false)
    @NotNull
    @Column(name = "temp")
    private float temp;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 150)
    @Column(name = "notes")
    private String notes;

    public MashNotes() {
    }

    public MashNotes(Integer noteID) {
        this.noteID = noteID;
    }

    public MashNotes(Integer noteID, int mashType, Date stopTime, float temp, String notes) {
        this.noteID = noteID;
        this.mashType = mashType;
        this.stopTime = stopTime;
        this.temp = temp;
        this.notes = notes;
    }

    public Integer getNoteID() {
        return noteID;
    }

    public void setNoteID(Integer noteID) {
        this.noteID = noteID;
    }

    public int getMashType() {
        return mashType;
    }

    public void setMashType(int mashType) {
        this.mashType = mashType;
    }

    public Date getStopTime() {
        return stopTime;
    }

    public void setStopTime(Date stopTime) {
        this.stopTime = stopTime;
    }

    public float getTemp() {
        return temp;
    }

    public void setTemp(float temp) {
        this.temp = temp;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (noteID != null ? noteID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MashNotes)) {
            return false;
        }
        MashNotes other = (MashNotes) object;
        if ((this.noteID == null && other.noteID != null) || (this.noteID != null && !this.noteID.equals(other.noteID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.MashNotes[ noteID=" + noteID + " ]";
    }
    
}
